<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>测试API</title>
<script src="${ctxStatic}/assets/user/index.js"></script>
<style type="text/css">
.avatar {
	width: 28px;
	height: 28px;
}

.presence {
	width: 16px;
	height: 16px;
	border: 0
}
</style>
</head>
<body>
	<div class="admin-content">
		<div class="am-g">
			<div class="am-u-sm-12 am-u-md-7">
				注册总人数:${totaluser}
			</div>
			<div class="am-u-sm-12 am-u-md-2">
				<div class="am-form-group">
					<select name="acctype" data-am-selected="{btnWidth: '100%',btnSize: 'sm'}">
						<option value="none">请选择...</option>
						<option value="phone">手机号</option>
						<option value="uid">uid</option>
						<option value="tradeno">交易号</option>
					</select>
				</div>
			</div>
			<div class="am-u-sm-12 am-u-md-3">
				<div class="am-input-group am-input-group-sm">
					<input name="accvalue" type="text" class="am-form-field" />
					<span class="am-input-group-btn"><button class="am-btn am-btn-default" type="button" id="search">搜索</button></span>
				</div>
			</div>
		</div>
<!-- 		<div class="am-container "> -->
		<div class="am-g">
			<div class="am-u-sm-12">
				<table
					class="am-table am-table-bd am-table-striped admin-content-table">
					<thead>
						<tr>
							<th>头像</th>
							<th>UID</th>
							<th>手机号</th>
							<th>昵称</th>
							<th>在线状态</th>
							<th>会员等级</th>
							<th>到期日期</th>
							<th>位置</th>
							<th>管理</th>
						</tr>
					</thead>
					<tbody>
					<script id="user-tpl" type="text/x-handlebars-template">
					{{#each this}}
  						<tr class="tmp">
							<td>{{#if avatar}}<img class="avatar" src="{{avatar}}">{{else}}&nbsp;{{/if}}</td>
							<td>{{id}}</td>
							<td>{{ifnull phone}}</td>
							<td>{{ifnull nick}}</td>
							{{#if online}}<td><img class="presence" src="${ctxStatic}/images/user-green-16x16.gif"/></td>
								{{else}}<td><img class="presence" src="${ctxStatic}/images/user-clear-16x16.gif"/></td>
							{{/if}}
							<td>{{ifnull lvl}}</td>
							<td>{{ifnull lvlEnd}}</td>
							<td>{{#if location}}{{location.lat}}<br/>{{location.lon}}{{/if}}</td>
							<td>
								<div class="am-btn-toolbar">
								  <div class="am-btn-group am-btn-group-xs">
									<button class="am-btn am-btn-default am-btn-xs am-text-secondary am-icon-pencil-square-o">编辑</button>
									<button class="am-btn am-btn-default am-btn-xs am-text-danger am-icon-trash-o"> 删除</button>
								  </div>
								</div>
							</td>
						</tr>
						{{#if orders}}
							<table class="am-table am-table-bd am-table-striped admin-content-table">
								<thead><th>支付类型</th><th>交易号</th><th>购买物品</th><th>交易金额</th><th>交易时间</th><th>状态</th><th>&nbsp;</th></thead>
								<tbody>
								{{#each orders}}
								<tr><td>{{payType}}</td><td>{{tradeNo}}</td><td>{{skuStr}}</td><td>{{totalFee}}</td><td>{{payTime}}</td><td>{{status}}</td>
									{{#extif canRefund}}
										<td><button class="am-btn am-btn-default am-btn-xs am-text-danger am-icon-rmb">退款</button></td>
									{{else}}
										&nbsp;
									{{/extif}}
								</tr>
								{{/each}}
								</tbody>
							</table>
						{{/if}}
					{{/each}}
					</script>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	
	<div class="am-modal am-modal-prompt" tabindex="-1" id="userEditLayer">
	  <div class="am-modal-dialog">
	    <div class="am-modal-hd">用户</div>
	    <div class="am-modal-bd">
	    <input type="text" class="am-modal-prompt-input" placeholder="级别">
<!-- 	       	级别:<select name="lvl" data-am-selected="{btnSize: 'sm'}"> -->
<!-- 						<option value="">取消会员</option> -->
<!-- 						<option value="TRY">TRY</option> -->
<!-- 						<option value="YEAR">YEAR</option> -->
<!-- 				</select> -->
<!-- 				<input type="hidden" name="uid" value="{{}}"/> -->
	    </div>
	    <div class="am-modal-footer">
	      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
	      <span class="am-modal-btn" data-am-modal-confirm>保存</span>
	    </div>
	  </div>
	</div>
</body>
</html>